package com.yb.xczx.cloud.auth.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.dialects.MySqlDialect;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/5/17 17:12
 * FileName: MybatisplusConfig
 * Description:
 */

@Configuration
@MapperScan("com.yb.xczx.cloud.auth.mapper")
public class MybatisplusConfig {

    @Bean
    PaginationInnerInterceptor paginationInnerInterceptor(){
        PaginationInnerInterceptor interceptor = new PaginationInnerInterceptor();
        interceptor.setDbType(DbType.MYSQL);
        interceptor.setDialect(new MySqlDialect());
        return interceptor;
    }
}
